<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateThesisDocumentsTable extends Migration
{
    public function up()
    {
        Schema::create('thesis_documents', function (Blueprint $table) {
            $table->id();
            $table->foreignId('selection_id')->constrained('topic_selections')->onDelete('cascade');
            $table->enum('type', ['draft', 'final']);
            $table->string('file_path', 255);
            $table->string('version', 20);
            $table->timestamp('submitted_at')->useCurrent();
            $table->text('feedback')->nullable();
        });
    }

    public function down()
    {
        Schema::dropIfExists('thesis_documents');
    }
} 